include_directories(../include/)
set(LIB_SHARED "${SDK_NAME}_shared")
set(LIB_STATIC "${SDK_NAME}_static")

# 配置编译宏定义

## release或debug
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
    message("BUILD TYPE: DEBUG")
    message("DEFINATION: \"DEBUG\"")
    set(CMAKE_BUILD_TYPE "Debug")
    add_definitions(-DDEBUG)
else()
    message("BUILD TYPE: RELEASE")
    message("DEFINATION: \"RELEASE\"")
    set(CMAKE_BUILD_TYPE "Release")
    add_definitions(-DRELEASE)
endif()

## 平台相关接口
if(WIN32) 
    message("WINDOWS PLATFORM")
    add_definitions(-DWINDOWS_PLATFORM)
elseif(APPLE)
    message(FATAL_ERROR "NOT SUPPORT")
elseif(UNIX)
    message("UNIX PLATFORM")
    add_definitions(-DUNIX_PLATFORM)
endif()
## 是否编译list相关接口
if(COMPILE_LIST)
    add_definitions(-DCOMPILE_DEFINITIONS_LIST)
endif(COMPILE_LIST)

file(GLOB C_SOURCE_FILE "*.c")

add_library(${LIB_SHARED} SHARED ${C_SOURCE_FILE})
add_library(${LIB_STATIC} STATIC ${C_SOURCE_FILE})

set_target_properties(${LIB_SHARED} PROPERTIES OUTPUT_NAME "${SDK_NAME}")
set_target_properties(${LIB_STATIC} PROPERTIES OUTPUT_NAME "${SDK_NAME}")